<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>运行服务 | Elastic Crontab System</title>
    <meta name="description" content="一款简单易用的分布式定时任务管理系统">
    
    
    <link rel="preload" href="/ects/assets/css/0.styles.4b878e04.css" as="style"><link rel="preload" href="/ects/assets/js/app.dc03944a.js" as="script"><link rel="preload" href="/ects/assets/js/11.8d62d449.js" as="script"><link rel="prefetch" href="/ects/assets/js/10.a9b3e2ed.js"><link rel="prefetch" href="/ects/assets/js/12.f9d3cea2.js"><link rel="prefetch" href="/ects/assets/js/13.de2731d4.js"><link rel="prefetch" href="/ects/assets/js/2.f8f0e8d9.js"><link rel="prefetch" href="/ects/assets/js/3.5a2a6f56.js"><link rel="prefetch" href="/ects/assets/js/4.fc5cf636.js"><link rel="prefetch" href="/ects/assets/js/5.3002656a.js"><link rel="prefetch" href="/ects/assets/js/6.fe2e5ce2.js"><link rel="prefetch" href="/ects/assets/js/7.fbbe362c.js"><link rel="prefetch" href="/ects/assets/js/8.50df79d7.js"><link rel="prefetch" href="/ects/assets/js/9.4a0eec1b.js">
    <link rel="stylesheet" href="/ects/assets/css/0.styles.4b878e04.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/ects/" class="home-link router-link-active"><!----> <span class="site-name">Elastic Crontab System</span></a> <div class="links" style="max-width:nullpx;"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/ects/introduction/architecture.html" class="nav-link">项目介绍</a></div><div class="nav-item"><a href="/ects/developer/" class="nav-link">开发文档</a></div><div class="nav-item"><a href="https://github.com/betterde/ects/releases" target="_blank" rel="noopener noreferrer" class="nav-link external">
  下载
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://github.com/betterde/ects" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/ects/introduction/architecture.html" class="nav-link">项目介绍</a></div><div class="nav-item"><a href="/ects/developer/" class="nav-link">开发文档</a></div><div class="nav-item"><a href="https://github.com/betterde/ects/releases" target="_blank" rel="noopener noreferrer" class="nav-link external">
  下载
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://github.com/betterde/ects" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><a href="/ects/introduction/architecture.html" class="sidebar-link">架构设计</a></li><li><a href="/ects/introduction/dependencies.html" class="sidebar-link">环境依赖</a></li><li><a href="/ects/introduction/configuration.html" class="sidebar-link">服务配置</a></li><li><a href="/ects/introduction/services.html" class="active sidebar-link">运行服务</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ects/introduction/services.html#命令行介绍" class="sidebar-link">命令行介绍</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/ects/introduction/services.html#master" class="sidebar-link">master</a></li><li class="sidebar-sub-header"><a href="/ects/introduction/services.html#worker" class="sidebar-link">worker</a></li></ul></li><li class="sidebar-sub-header"><a href="/ects/introduction/services.html#启动-master-节点" class="sidebar-link">启动 master 节点</a></li><li class="sidebar-sub-header"><a href="/ects/introduction/services.html#启动-worker-节点" class="sidebar-link">启动 worker 节点</a></li><li class="sidebar-sub-header"><a href="/ects/introduction/services.html#运行单机模式" class="sidebar-link">运行单机模式</a></li></ul></li><li><a href="/ects/introduction/managerment.html" class="sidebar-link">管理任务</a></li><li><a href="/ects/introduction/more.html" class="sidebar-link">更多</a></li></ul> </div> <div class="page"> <div class="content"><h1 id="运行服务"><a href="#运行服务" aria-hidden="true" class="header-anchor">#</a> 运行服务</h1> <h2 id="命令行介绍"><a href="#命令行介绍" aria-hidden="true" class="header-anchor">#</a> 命令行介绍</h2> <h3 id="master"><a href="#master" aria-hidden="true" class="header-anchor">#</a> master</h3> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>$ ects master -h
Run a master node <span class="token function">service</span> on this server

Usage:
  ects master <span class="token punctuation">[</span>flags<span class="token punctuation">]</span>

Flags:
      --config string   Set the key used to get configuration information <span class="token punctuation">(</span>default <span class="token string">&quot;/ects/config&quot;</span><span class="token punctuation">)</span>
      --desc string     Set master node description <span class="token punctuation">(</span>default <span class="token string">&quot;master node&quot;</span><span class="token punctuation">)</span>
      --etcd strings    Set Etcd endpoints <span class="token punctuation">(</span>default <span class="token punctuation">[</span><span class="token number">127.0</span>.0.1:2379<span class="token punctuation">]</span><span class="token punctuation">)</span>
  -h, --help            <span class="token builtin class-name">help</span> <span class="token keyword">for</span> master
      --host string     Set listen on IP <span class="token punctuation">(</span>default <span class="token string">&quot;0.0.0.0&quot;</span><span class="token punctuation">)</span>
      --name string     Set master node name
  -n, --node string     Set master node <span class="token function">id</span> <span class="token punctuation">(</span>default <span class="token string">&quot;b2567790-0f8d-458e-8560-6dff90e8c4ad&quot;</span><span class="token punctuation">)</span>
      --port int        Set listen on port <span class="token punctuation">(</span>default <span class="token number">9701</span><span class="token punctuation">)</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><ul><li>config：系统配置信息在 ETCD 中的 Key</li> <li>desc：节点的描述</li> <li>etcd：etcd 的 endpoints，用英文逗号隔开</li> <li>host：服务监听的地址</li> <li>name：节点名称</li> <li>node：节点ID，如果未提供节点ID，则自动生成ID，并注册到 MySQL</li> <li>port 服务监听端口</li></ul> <h3 id="worker"><a href="#worker" aria-hidden="true" class="header-anchor">#</a> worker</h3> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>$ ects worker -h
Run a worker node <span class="token function">service</span> on this server

Usage:
  ects worker <span class="token punctuation">[</span>flags<span class="token punctuation">]</span>

Flags:
      --config string   Set the key used to get configuration information <span class="token punctuation">(</span>default <span class="token string">&quot;/ects/config&quot;</span><span class="token punctuation">)</span>
      --desc string     Set worker node description <span class="token punctuation">(</span>default <span class="token string">&quot;worker node&quot;</span><span class="token punctuation">)</span>
      --etcd strings    Set Etcd endpoints <span class="token punctuation">(</span>default <span class="token punctuation">[</span><span class="token number">127.0</span>.0.1:2379<span class="token punctuation">]</span><span class="token punctuation">)</span>
  -h, --help            <span class="token builtin class-name">help</span> <span class="token keyword">for</span> worker
      --name string     Set worker node name
  -n, --node string     Set node <span class="token function">id</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br></div></div><ul><li>config：系统配置信息在 ETCD 中的 Key</li> <li>desc：节点的描述</li> <li>etcd：etcd 的 endpoints，用英文逗号隔开</li> <li>name：节点名称</li> <li>node：节点ID，如果未提供节点ID，则自动生成ID，并注册到 MySQL</li></ul> <h2 id="启动-master-节点"><a href="#启动-master-节点" aria-hidden="true" class="header-anchor">#</a> 启动 master 节点</h2> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>$ ects master <span class="token punctuation">\</span>
--name<span class="token operator">=</span>Master <span class="token punctuation">\</span>
--desc<span class="token operator">=</span><span class="token string">&quot;master node&quot;</span> <span class="token punctuation">\</span>
--config<span class="token operator">=</span>/ects/config <span class="token punctuation">\</span>
--etcd<span class="token operator">=</span><span class="token number">127.0</span>.0.1:2379 <span class="token punctuation">\</span>
--host<span class="token operator">=</span><span class="token number">192.168</span>.1.253 <span class="token punctuation">\</span>
--port<span class="token operator">=</span><span class="token number">9701</span> <span class="token punctuation">\</span>
--node<span class="token operator">=</span>24b29238-86bb-4cf7-a52a-be009d768c84
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><h2 id="启动-worker-节点"><a href="#启动-worker-节点" aria-hidden="true" class="header-anchor">#</a> 启动 worker 节点</h2> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>$ ects worker <span class="token punctuation">\</span>
--name<span class="token operator">=</span>Master <span class="token punctuation">\</span>
--desc<span class="token operator">=</span><span class="token string">&quot;worker node&quot;</span> <span class="token punctuation">\</span>
--config<span class="token operator">=</span>/ects/config <span class="token punctuation">\</span>
--etcd<span class="token operator">=</span><span class="token number">127.0</span>.0.1:2379 <span class="token punctuation">\</span>
--node<span class="token operator">=</span>24b29238-86bb-4cf7-a52a-be009d768c84
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><h2 id="运行单机模式"><a href="#运行单机模式" aria-hidden="true" class="header-anchor">#</a> 运行单机模式</h2> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>$ ects single
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></div> <div class="page-edit"><!----> <!----></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/ects/introduction/configuration.html" class="prev">
          服务配置
        </a></span> <span class="next"><a href="/ects/introduction/managerment.html">
          管理任务
        </a>
        →
      </span></p></div> </div> <!----></div></div>
    <script src="/ects/assets/js/app.dc03944a.js" defer></script><script src="/ects/assets/js/11.8d62d449.js" defer></script>
  </body>
</html>
